

{{ await Mode("TPL").Render("@"+KUO.CLASS+"/"+TPLtemp+"/head",KUO,THIS) }}
<div class="kuoneir" style="position: relative;">
    <div class="layui-hide-xs" style="background:url('{{ pichttp(KUO.$DATA.photo)}}') no-repeat;height:200px;background-size:100%;width: 100%;height: 410px;"></div>
    <div class="kuoneir2">
      <div class="layui-container">
          <div class="neirong">
            <div class="layui-row layui-col-space10"> 
              <div class="layui-col-md4 layui-col-xs12">
                <img src="{{ pichttp(KUO.$DATA['photo']) }}" class="image"></img>
              </div>
              <div class="layui-col-md8 layui-col-xs12">
                <div class="younr">
                  <h1>{{ KUO.$DATA['name'] }}</h1>
                  <div class="sosokey" >
                    {{# 
                        if(KUO.$DATA.keywords != ""){ 
                            let keyx = explode(",",KUO.$DATA.keywords);
                            for(var xx in keyx){
                            }}
                            <a href="{{KuoLink([KUO.CLASS,'soso',keyx[xx] ])}}" title="{{keyx[xx]}}">{{keyx[xx]}}</a>
                            {{#
                            }
                        } 
                    }}
                    
                  </div>
                  <ul class="shuxing">
                    <li class="hangshu" style="width:96%;"><span class="hbt">评分:</span><span id="test1"></span></li>

                    {{# 
                        let jiexi = JSON_DECODE(KUO.$DATA.text1);
                       
                        if(!jiexi && typeof(KUO.$DATA.text1) == "string"){
                            jiexi= KUO.$DATA.text1.split("\n");
                        }
                        if(jiexi){
                    
                            for(let xm in jiexi){
                                let jixm = jiexi[xm].split(":");
                    }}
                    <li class="hangshu">
                        {{# if(jixm.length > 1){ }}
                        <span class="hbt">{{jixm[0]}}:</span>{{jixm[1]}}
                        {{# }else{ }}
                            {{jixm[0]}}
                        {{# } }}
                    </li>

                    {{#  } } }}
                    
                    <li class="hangshu"><span class="hbt">人气:</span><b id="popularity">{{KUO.$DATA.popularity }}</b> </li>
                   
                  </ul>

               
                   <div class="desc">{{ KUO.$DATA['describes'] }}</div>
                    {{# if(KUO.$DATA.int1 == 3){ 

                        var mmm = { headers:{},body:null,atime:Mode("Tools").Time() };
                        let $kkk = await Mode("cms").TongXinKey('chapter_list_'+KUO.$DATA['id']+'_'+mmm.atime,'KuoSoft',mmm.atime);
                        
                        await Mode("chapter").list({URL:['chapter','list'], post : { id:KUO.$DATA['id'],key:$kkk,atime:mmm.atime} },mmm);
                   
                        var list = JSON_DECODE(mmm.body);
                       
                        let chapterurl = KuoLink([ KUO.CLASS, KUO.$DATA['url'],'0' ]);
                    }}
                    <div class="anniuzu">
                        {{# if(list && list.data.list && list.data.list.length > 0){ }}
                        <a href="{{chapterurl}}" class="daanniu" id="goyuedu"> <i class="layui-icon layui-icon-read"></i> 开始阅读</a>
                        {{# } }}
                        <a onclick="shoucang()" class="daanniu youbiande" style="background: #ffd421;color: #6a2501;" id="shoucangx"> <i class="layui-icon layui-icon-star" ></i> 收藏</a>
                    </div>
                    {{# } }}
                
                </div>

              </div>
            </div>
            {{# if(KUO.$DATA.int1 == 3){ }}
                <div class="chapter">
                <div class="newzuixin">
                    <span class="mmmm">{{ KUO.$DATA['remarks'] }}</span> 最新: {{ KUO.$DATA['char1'] }}
                    <span class="paixu" id="gopaixu"> <i class="layui-icon layui-icon-down"></i>正序</span>
                </div>
                <ul class="list-box clearfix hide" >

                    {{#
                        
                        if(list && list.data.list && list.data.list.length > 0){
                            let LIST = list.data.list;
                            for(var xm in LIST){
                                
                    }}<li class="j-chapter-item chapter_item chapterid{{LIST[xm].id}}"> 
                        <a class="j-chapter-link"  href="{{  KuoLink([ KUO.CLASS, KUO.$DATA['url'],LIST[xm].id ])  }}" >{{ LIST[xm].vip>0?'<i class="layui-icon" style="color:Red;">vip</i>':(LIST[xm].money>0 || LIST[xm].timemoney>0?'<i class="layui-icon layui-icon-rmb"></i>':'')  }}   {{LIST[xm].name}} </a></li>{{#

                            }
                          
                        }
                        
                    
                    }}
                    


                </ul>
                
                </div>
                {{# if(list && list.data.list && list.data.list.length > 4){ }}
                <div class="shouqilai">
                    <a href="javascript:shouqilai();" id="ttttt">查看所有章节 <i class="layui-icon layui-icon-down "></i></a>
                </div>
                {{# } }}

            {{# } }}

            <div class="conter">

                {{#
                    let $TUPIANJI = Mode("Tools").TIQUimg(KUO.$DATA['content']);
                    if(KUO.$DATA['photoalbum'] != ""){
                        $TUPIANJI = explode(',',KUO.$DATA['photoalbum']);
                    }
                    if($TUPIANJI){
                        let $TI = [];
                        let $HU = [];
                    
                        for( let $ti in $TUPIANJI ){
                            let $photo = $TUPIANJI[$ti];
                            if($photo == ""){
                                continue ;
                            }
                            $TI.push($photo);
                            $HU.push(pichttp($photo));

                        }
                }}
                    {{ str_replace( $TI, $HU, KUO.$DATA['content']) }}
                {{# }else{ }}
                    {{ KUO.$DATA.content }}
                {{# } }}

              
            </div>

          </div> 

          <div class="kuolistnav">
            
            <p class="youbian" style="font-size:18px;">热门推荐</p>
        </div>
        <div class="layui-row layui-col-space15"> 

            {{#
                let $WWH = {'subclass':KUO.$DATA['subclass'],'off':2}; 
                let $MEYE = 18;
                let $游戏数据 = await  THIS.CENTER_select($WWH,"sortsize desc,popularity desc",12  );
           
                if( $游戏数据 ){
                    for(let $ii in $游戏数据 ){
                        let $eli = $游戏数据 [$ii ];
                        let $eliurl = KuoLink([ KUO.CLASS, $eli['url'] ]);
                        
                }}
    
                <div class="layui-col-md2 layui-col-xs6 kuolistbody">
                    <div class="tupian">
                        <a href="{{$eliurl}}"><img src="{{CDNHOST}}Tpl/cms/manhua/image/loadimg.png" lay-src="{{pichttp($eli.photo)}}" class="image"></img>
                            {{# if($eli.remarks && $eli.remarks != ""){ }}
                            <span class="jiaobiao"> {{$eli.remarks}}</span>
                            {{# } }}
                        </a>
                    </div>
                    <div class="biaoti">
                       
                        <a href="{{$eliurl}}">{{$eli.name}}</a>
                    </div>
                    <div class="gengxin">
                        更至：<span class="zuixin">{{$eli.char1}}</span>
                    </div>
                    <div class="renqi">
                        人气：{{$eli.popularity}}
                    </div>
                    
                </div>
                    {{#
                    }   }else{  }}
                        <div class="Nodata">
                            没有相关数据
                        </div>
                    {{# } }}
          
        </div>
        <div style="height:20px;"></div>
      </div>
    </div>
</div>
{{ await Mode("TPL").Render("@"+KUO.CLASS+"/"+TPLtemp+"/foot",KUO,THIS) }}
<script>
var ID = "{{KUO.$DATA['id']}}";
var shouqi = false;
function shoucang(){

    if(UID < 1 ){

        login(shoucang);
        return ;
    }


    apptongxin("chapter/collect",{id:ID},function(data){
        if(data.code == 1){
            if(typeof(data.data.collect) != "undefined"){
                if(data.data.collect == 1){
                    $("#shoucangx").html('<i class="layui-icon layui-icon-star-fill" ></i> 收藏'); 
                }else{
                    $("#shoucangx").html('<i class="layui-icon layui-icon-star" ></i> 收藏'); 
                }
            }
        }
    });
}


function shouqilai(){
  if(shouqi){
    shouqi = false;
    $(".chapter").css({"max-height":"288px"});
    $("#ttttt").html('查看所有章节 <i class="layui-icon layui-icon-down "></i>');
 
    console.log("shoulai");
  }else{
    shouqi = true;
    $(".chapter").css({"max-height":"none"});
    $("#ttttt").html('收起  <i class="layui-icon layui-icon-up"></i>');
   
  }
}
var PAIXU = true;
$(function(){
  
  layui.flow.lazyimg(); 
 
     layui.rate.render({
      length:5,
      value:'{{KUO.$DATA.recommend}}',
      half:false,
      readonly:true,
      elem: '#test1' 
    });
    $("#gopaixu").click(function(){
        if(PAIXU){
            PAIXU = false;
        }else{
            PAIXU = true;
        }
        var mylist = $('.list-box');                 
        var listitems = mylist.children('li').get();
        listitems.reverse();
        $.each(listitems, function(idx, itm) { mylist.append(itm); });
        if(PAIXU){
            $("#gopaixu").html('<i class="layui-icon layui-icon-down "></i>正序');
        }else{ $("#gopaixu").html('<i class="layui-icon layui-icon-up "></i>倒序');
           

        }


    });
    apptongxin("cms/json/datarenqi",{id:ID},function(data){
        if(data.code == 1){
            $("#popularity").html(data.data);
        }
    });
    /* {{# if(KUO.$DATA.int1 == 3){ }} */
    apptongxin("chapter/getcollect",{id:ID},function(data){
        
        if(data.code == 1 && data.data){

            if(data.data.uid > 0){
                UID = data.data.uid ;
            }
    
            if( data.data.collect == 1){
                $("#shoucangx").html('<i class="layui-icon layui-icon-star-fill" ></i> 收藏'); 
            }
            if( data.data.chapterid > 0){
                $("#goyuedu").attr({href:'{{ KuoLink([ KUO.CLASS, KUO.$DATA["url"] ],2)  }}'+data.data.chapterid+'{{WebExt}}' });
                $("#goyuedu").html('<i class="layui-icon layui-icon-read"></i> 继续阅读');
                $(".chapter_item").removeClass("hover");
                $(".chapterid"+data.data.chapterid).addClass("hover");
            }
        }
    });
 
    /* {{# } }} */
});
</script>